﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="bookmanager.aspx.cs" Inherits="admin_bookmanager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <div style="background-image: url('/bookWEB/images/NFLDfog_ZH-CN4846953507_1920x1080.jpg'); width: auto; height: 1000px;">

    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="BI_BID" DataSourceID="SqlDataSource2" Height="450px" 
            Width="1031px" AllowPaging="True" BackColor="#DEBA84" 
            BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
            CellSpacing="2" HorizontalAlign="Center" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" PageSize="5" 
            style="margin-bottom: 0px">
            <Columns>
                <asp:BoundField DataField="BI_BID" HeaderText="图书号" ReadOnly="True" 
                    SortExpression="BI_BID" />
                <asp:BoundField DataField="BI_TYPE" HeaderText="图书类型" 
                    SortExpression="BI_TYPE" />
                <asp:BoundField DataField="BI_TITLE" HeaderText="图书名" 
                    SortExpression="BI_TITLE" />
                <asp:BoundField DataField="BI_AUTHOR" HeaderText="图书作者" 
                    SortExpression="BI_AUTHOR" />
                <asp:BoundField DataField="BI_NOB" HeaderText="图书库存" 
                    SortExpression="BI_NOB" />
                <asp:CommandField ButtonType="Button" ShowDeleteButton="True" 
                    ShowEditButton="True" />
            </Columns>
            <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
            <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
            <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
            <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" HorizontalAlign="Center" 
                Width="147px" />
            <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#FFF1D4" />
            <SortedAscendingHeaderStyle BackColor="#B95C30" />
            <SortedDescendingCellStyle BackColor="#F1E5CE" />
            <SortedDescendingHeaderStyle BackColor="#93451F" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:tsmanagerConnectionString %>" 
            SelectCommand="SELECT * FROM [BookInformation] ORDER BY [BI_BID]">
        </asp:SqlDataSource>
    
        <br />
        <br />
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
            CellPadding="3" DataKeyNames="BI_BID,librarianID" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" />
                <asp:BoundField DataField="RMF_WTIME" HeaderText="RMF_WTIME" 
                    SortExpression="RMF_WTIME" />
                <asp:BoundField DataField="BI_BID" HeaderText="BI_BID" ReadOnly="True" 
                    SortExpression="BI_BID" />
                <asp:BoundField DataField="librarianID" HeaderText="librarianID" 
                    ReadOnly="True" SortExpression="librarianID" />
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:tsmanagerConnectionString %>" 
            DeleteCommand="DELETE FROM [BookManagement] WHERE [BI_BID] = @BI_BID AND [librarianID] = @librarianID" 
            InsertCommand="INSERT INTO [BookManagement] ([RMF_WTIME], [BI_BID], [librarianID]) VALUES (@RMF_WTIME, @BI_BID, @librarianID)" 
            SelectCommand="SELECT * FROM [BookManagement]" 
            UpdateCommand="UPDATE [BookManagement] SET [RMF_WTIME] = @RMF_WTIME WHERE [BI_BID] = @BI_BID AND [librarianID] = @librarianID">
            <DeleteParameters>
                <asp:Parameter Name="BI_BID" Type="String" />
                <asp:Parameter Name="librarianID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="RMF_WTIME" Type="String" />
                <asp:Parameter Name="BI_BID" Type="String" />
                <asp:Parameter Name="librarianID" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="RMF_WTIME" Type="String" />
                <asp:Parameter Name="BI_BID" Type="String" />
                <asp:Parameter Name="librarianID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
